﻿using System;

namespace Sencha.Direct.Exceptions
{
	[Serializable]
	public sealed class RemoteInvocationException : System.Net.WebException
	{
		private JsError m_jsError;

		public JsError OriginalError { get { return m_jsError; } }

		internal RemoteInvocationException(JsError jsError)
			: base(Loc.GetErrorString("Exception_RemoteInvocationException", jsError.Name, jsError.Message, jsError.Description))
		{
			m_jsError = jsError;
		}

		protected RemoteInvocationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
			: base(info, context)
		{
		}
	}
}
